﻿namespace OneWorks.Web.Api.Controllers
{
    using System.Web.Mvc;
    using Extension;
    using Common.Model;
    using Common;

    using Controller = Extension.Controller;

    public class UserController : Controller
    {
        private readonly UserHandle _userHandle = new UserHandle();

        [HttpPost]
        public CustomJsonResult Create(AccountModel model)
        {
            return CustomJson(_userHandle.Create(model));
        }

        public CustomJsonResult ExistsAccount(string acction)
        {
            return CustomJson(_userHandle.ExistAccount(acction));
        }

        public CustomJsonResult ErrorCount(string value)
        {
            return CustomJson(_userHandle.GetLoginStatus(value));
        }
    }
}
